package com.hellobike.haxing.modules.wms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hellobike.haxing.modules.wms.entity.ShippingDetail;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @Description: t_wms_shipping_detail
 * @Author: haxing-boot
 * @Date:   2020-02-02
 * @Version: V1.0
 */
public interface ShippingDetailMapper extends BaseMapper<ShippingDetail> {

    @Select("SELECT d.* FROM t_wms_shipping_detail as d LEFT JOIN t_wms_shipping_header as h ON h.id=d.shipping_header_id " +
            "WHERE d.deleted = 0 AND h.shipping_type=#{type} AND d.delivery_header_id=#{headerId}")
    ShippingDetail getByDeliveryOrderIdAndType(@Param("headerId") Long headerId, @Param("type") String type);
}
